package com.sanyang.lawyer.controller.client;

import com.sanyang.lawyer.ResultApi.ResponseResult;
import com.sanyang.lawyer.entity.Client_type;
import com.sanyang.lawyer.service.client.ClientTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("client_type")
public class ClienttypeController {
    
    
    @Autowired
    private ClientTypeService typeService;

    //查询所有的客户类型
    @RequestMapping("listall")
    public ResponseResult<List<Client_type>> listall(){
        return ResponseResult.success(typeService.listall());
    }

    //通过客户类型编号查询出指定类型
    @RequestMapping("getbyid")
    public ResponseResult<Client_type> getbyid(int typeid){
        return ResponseResult.success(typeService.getbyid(typeid));
    }
}
